package com.bachelor.community.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private String code;
    private Boolean flag;
    private Object data;
    private String msg;

    public static Result succeed(String code, Object data) {
        return new Result(code, true, data, null);
    }

    public static Result fail(String code, String message) {
        return new Result(code, false, null, message);
    }
}
